import React, { Component } from 'react';
import { Descriptions, Divider, Table } from 'antd';
import styles from "@/pages/Order/Details/index.less";
import FourItemapply1 from "@/pages/Order/Details/PublicCard/FourItemapply1";
import FiveItem from "@/pages/Order/Details/PublicCard/FiveItem";
import FourItem1 from "@/pages/Order/Details/PublicCard/FourItem1";
import FiveItemrepay from "@/pages/Order/Details/PublicCard/FiveItemrepay";
import ThreeItem from "@/pages/Order/Details/PublicCard/ThreeItem";
import Historyoverdue1 from "@/pages/Order/Details/Historyoverdue1";
import CourtriskList from "@/pages/Order/Details/CourtriskList";

// 天狼星星耀版
class BooleanReport2 extends Component {
  render() {
    const { redata = {} } = this.props;

    const signLess = {
      display: "flex", flexDirection: "column", textAlign: "left", fontSize: 14, color: '#333'
    }
    const riskSign = (<div className={signLess}>
      {redata && redata.hit_risk_tagging && redata.hit_risk_tagging.map((item, sign) => {
        return (<span key={sign}>
                {sign + 1}、{item}；
              </span>);
      })}
    </div>);
    const scoreStandard1 = (<div className={signLess}>
      <span>分值在(0-650)之间，得分越低，风险越高:</span><br/>
      <span>[0-450]，建议拒绝；</span><br/>
      <span>(450-530]，建议审核；</span><br/>
      <span>(530-650]，建议通过；</span>
    </div>);
    const timeOnlineObj = {
      '1': '0-3个月',
      '2': '3-6个月',
      '3': '6-12个月',
      '4': '12-24个月',
      '5': '24个月以上',
      '0': '查无此号或已注销',
      '-1': '不支持该运营商',
      '999': '手机状态异常'
    }
    const titleName = {
      first: '消费分期类申请机构数 (个) ',
      second: '网络贷款类申请机构数 (个) ',
      three: '最近一次申请日期',
      four: '距离最近一次申请日期已有 (天) ',
    };
    const fiveTitle = {
      first: '', second: '近1个月', three: '近3个月', four: '近6个月', five: '近12个月',
    };
    const fiveTitlerepay = {
      first: '', second: '近1个月', three: '近3个月', four: '近6个月', five: '近12个月', six: '近24个月'
    };
    const nameObject = {
      first: '消费分期类放款机构数 (个) ',
      second: '网络贷款类放款机构数 (个) ',
      three: '最近一次放款日期',
      four: '距离最近一次放款日期已有 (天) ',
    };
    const threeName = {
      first: '近1个月',
      second: '近12个月',
      one: '近1个月',
      three: '近3个月',
      six: '近6个月',
      twelve: '近12个月',
      twentyfour: '近24个月',
      observeNum: '正常履约次数(次)',
      unobserveNum: '还款异常次数(次)',
    };

    return (<>
      <Descriptions column={4} layout="vertical" bordered>
        <Descriptions.Item label="综合评分">
                    <span style={{ fontSize: 20, color: '#333', fontWeight: 'bold' }}>
                          {redata.score_norm_explain}
                      </span>
        </Descriptions.Item>
        <Descriptions.Item label="审核建议">
          <span>{redata.verify_recomment}</span>
        </Descriptions.Item>
        <Descriptions.Item label="命中风险标注">{riskSign}</Descriptions.Item>
        <Descriptions.Item label="分值标注说明">{scoreStandard1}</Descriptions.Item>
      </Descriptions>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>基本信息</Divider>
      <Descriptions column={2}>
        <Descriptions.Item label="姓名">
          {redata.base_info && redata.base_info.name}
        </Descriptions.Item>
        <Descriptions.Item label="身份证号">
          {redata.base_info && redata.base_info.ident_number}
        </Descriptions.Item>
        <Descriptions.Item label="手机号">
          {redata.base_info && redata.base_info.phone}
        </Descriptions.Item>
        <Descriptions.Item label="年龄">
          {redata.base_info && redata.base_info.age}
        </Descriptions.Item>
        <Descriptions.Item label="户籍">
          {redata.base_info && redata.base_info.ident_number_address}
        </Descriptions.Item>
        <Descriptions.Item label="号码归属地">
          {redata.base_info && redata.base_info.phone_address}
        </Descriptions.Item>
      </Descriptions>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>实名信息</Divider>
      <Descriptions column={2}>
        <Descriptions.Item label="实名核验">
          {redata.ident_info_dict && (redata.ident_info_dict.identity_two_elements == '01' ? '不一致' : '一致')}
        </Descriptions.Item>
        <Descriptions.Item label="运营商核验">
          {redata.ident_info_dict && (redata.ident_info_dict.network_triple_elemen == '01' ? '不一致' : '一致')}
        </Descriptions.Item>
        <Descriptions.Item label="运营商在网时长">
          {redata.ident_info_dict && timeOnlineObj[redata.ident_info_dict.time_online]}
        </Descriptions.Item>
      </Descriptions>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>风险名单监测</Divider>
      <Descriptions column={3}>
        <Descriptions.Item label="归属地位于高风险集中地区">
          {redata.risk_list_check && redata.risk_list_check.census_register_high_risk_area == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
        <Descriptions.Item label="车辆租赁违约名单">
          {redata.risk_list_check && redata.risk_list_check.idcard_hit_clzlwy == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
        <Descriptions.Item label="犯罪通缉名单">
          {redata.risk_list_check && redata.risk_list_check.idcard_hit_fztj == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
        <Descriptions.Item label="故意违章乘车名单">
          {redata.risk_list_check && redata.risk_list_check.idcard_hit_gywzcc == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
        <Descriptions.Item label="通信小号库">
          {redata.risk_list_check && redata.risk_list_check.phone_hit_txxh == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
        <Descriptions.Item label="虚拟号码库">
          {redata.risk_list_check && redata.risk_list_check.phone_hit_xjhm == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
        <Descriptions.Item label="特殊关注名单">
          {redata.risk_list_check && redata.risk_list_check.result_xd == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
        <Descriptions.Item label="信用租赁风险名单">
          {redata.risk_list_check && redata.risk_list_check.credit_rent == '1' ? (
            <div style={{ color: 'red' }}>命中</div>) : ('未命中')}
        </Descriptions.Item>
      </Descriptions>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>机构查询记录</Divider>
      <Descriptions column={3} layout="vertical" bordered>
        <Descriptions.Item
          label="近7天一般消费分期平台查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.d7_apply_setup_time_ybxffq}</Descriptions.Item>
        <Descriptions.Item
          label="近30天一般消费分期平台查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m1_apply_setup_time_ybxffq}</Descriptions.Item>
        <Descriptions.Item
          label="近90天一般消费分期平台查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m3_apply_setup_time_ybxffq}</Descriptions.Item>
        <Descriptions.Item
          label="近7天信用卡查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.d7_apply_setup_time_xyk}</Descriptions.Item>
        <Descriptions.Item
          label="近30天信用卡查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m1_apply_setup_time_xyk}</Descriptions.Item>
        <Descriptions.Item
          label="近90天信用卡查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m3_apply_setup_time_xyk}</Descriptions.Item>
        <Descriptions.Item
          label="近7天P2P平台查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.d7_apply_setup_time_p2pwd}</Descriptions.Item>
        <Descriptions.Item
          label="近30天P2P平台查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m1_apply_setup_time_p2pwd}</Descriptions.Item>
        <Descriptions.Item
          label="近90天P2P平台查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m3_apply_setup_time_p2pwd}</Descriptions.Item>
        <Descriptions.Item
          label="近7天大型消费金融公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.d7_apply_setup_time_dxxfjr}</Descriptions.Item>
        <Descriptions.Item
          label="近30天大型消费金融公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m1_apply_setup_time_dxxfjr}</Descriptions.Item>
        <Descriptions.Item
          label="近90天大型消费金融公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m3_apply_setup_time_dxxfjr}</Descriptions.Item>
        <Descriptions.Item
          label="近7天小额贷款公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.d7_apply_setup_time_xedkgs}</Descriptions.Item>
        <Descriptions.Item
          label="近30天小额贷款公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m1_apply_setup_time_xedkgs}</Descriptions.Item>
        <Descriptions.Item
          label="近90天小额贷款公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m3_apply_setup_time_xedkgs}</Descriptions.Item>
        <Descriptions.Item
          label="近7天其他类型公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.d7_apply_setup_time_other}</Descriptions.Item>
        <Descriptions.Item
          label="近30天其他类型公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m1_apply_setup_time_other}</Descriptions.Item>
        <Descriptions.Item
          label="近90天其他类型公司查询(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m3_apply_setup_time_other}</Descriptions.Item>
        <Descriptions.Item
          label="近7天机构查询总数(次)">{redata.personal_loan_demand && redata.personal_loan_demand.d7_apply_setup_time}</Descriptions.Item>
        <Descriptions.Item
          label="近30天机构查询总数(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m1_apply_setup_time}</Descriptions.Item>
        <Descriptions.Item
          label="近90天机构查询总数(次)">{redata.personal_loan_demand && redata.personal_loan_demand.m3_apply_setup_time}</Descriptions.Item>
      </Descriptions>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>历史借贷行为</Divider>
      <div className={styles.historyWrap}>
        <div className={styles.total}>
          <span style={{ fontWeight: 'bold' }}>近12个月申请机构总数&emsp;(个)：</span>
          <span>{redata && redata.personal_loan_s && redata.personal_loan_s.apply_mechanism_number === '无记录' ? 0 : redata && redata.personal_loan_s && redata.personal_loan_s.apply_mechanism_number}</span>
        </div>
        <FourItemapply1
          style={{ marginTop: 14 }}
          title={titleName}
          data={redata && redata.personal_loan_s}
        />
        <FiveItem
          style={{ marginTop: 22 }}
          title={fiveTitle}
          text="申请次数(次)"
          data={redata && redata.personal_loan_s}
        />
        <div className={styles.total}>
          <span style={{ fontWeight: 'bold' }}>近24个月放款机构总数&emsp;(个)：</span>
          <span>
          {redata && redata.personal_loan_f && redata.personal_loan_f.lenders === '' ? '无记录' : redata && redata.personal_loan_f && redata.personal_loan_f.lenders}
            </span>
        </div>
        <FourItem1
          style={{ marginTop: 14 }}
          title={nameObject}
          data={redata && redata.personal_loan_f}
        />
        <FiveItemrepay
          style={{ marginTop: 22 }}
          title={fiveTitlerepay}
          text="放款次数(次)/放款金额(元)"
          data={redata && redata.personal_loan_f}
        />
        <ThreeItem
          style={{ marginTop: 22 }}
          title={threeName}
          data={(redata && redata.personal_loan_f && redata.personal_loan_f.repay_succ1) ? redata.personal_loan_f : redata.personal_loan_h}
        />
      </div>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>历史租赁行为</Divider>
      <Descriptions column={5} layout="vertical" bordered>
        <Descriptions.Item
          label="近7天申请租赁次数">{redata.rent_history && (redata.rent_history.rent_history_times_d7 || redata.rent_history.d7_apply_time)}</Descriptions.Item>
        <Descriptions.Item
          label="近1个月申请租赁次数">{redata.rent_history && (redata.rent_history.rent_history_times_m1 || redata.rent_history.m1_apply_time)}</Descriptions.Item>
        <Descriptions.Item
          label="近3个月申请租赁次数">{redata.rent_history && (redata.rent_history.rent_history_times_m3 || redata.rent_history.m3_apply_time)}</Descriptions.Item>
        <Descriptions.Item
          label="近6个月申请租赁次数">{redata.rent_history && (redata.rent_history.rent_history_times_m6 || redata.rent_history.m6_apply_time)}</Descriptions.Item>
        <Descriptions.Item
          label="近12个月申请租赁次数">{redata.rent_history && (redata.rent_history.rent_history_times_m12 || redata.rent_history.m12_apply_time)}</Descriptions.Item>
        <Descriptions.Item
          label="近7天申请租赁机构数">{redata.rent_history && redata.rent_history.d7_apply_agency_time}</Descriptions.Item>
        <Descriptions.Item
          label="近1个月申请租赁机构数">{redata.rent_history && redata.rent_history.m1_apply_agency_time}</Descriptions.Item>
        <Descriptions.Item
          label="近3个月申请租赁机构数">{redata.rent_history && redata.rent_history.m3_apply_agency_time}</Descriptions.Item>
        <Descriptions.Item
          label="近6个月申请租赁机构数">{redata.rent_history && redata.rent_history.m6_apply_agency_time}</Descriptions.Item>
        <Descriptions.Item
          label="近12个月申请租赁机构数">{redata.rent_history && redata.rent_history.m12_apply_agency_time}</Descriptions.Item>
      </Descriptions>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>历史逾期记录</Divider>
      <Historyoverdue1 data={redata && redata.personal_overdue_history}/>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>关联风险检测</Divider>
      <Descriptions column={1}>
        <Descriptions.Item label="3个月身份证关联手机号数(个)">
          {redata && redata.relevance_risk_check && redata.relevance_risk_check.m3_idcard_to_phone_time}
        </Descriptions.Item>
        <Descriptions.Item label="3个月手机号关联身份证数(个)">
          {redata && redata.relevance_risk_check && redata.relevance_risk_check.m3_phone_to_idcard_time}
        </Descriptions.Item>
      </Descriptions>
      <Divider style={{ fontSize: '20px', marginTop: 50 }}>法院风险信息</Divider>
      <CourtriskList data={redata && redata.court_risk_info_list}/>
    </>)
  }
}

export default BooleanReport2;
